# coding:utf-8
# filename: yangsy.py

import requests
import json

url ='https://testpassport.rabbitpre.com/api/sso/login'
s = {"account": "18883552113", "password": "abc123456", "fromType": "pc"}
r = requests.post(url,json = s)
cookies = r.cookies
# print(r.text)

# 获取user接口：
api_url = 'https://bws.test.rabbitpre.com/api/user'
req = requests.get(api_url,cookies = cookies)
text = req.text
print(text)

# 获取orgId和userId:
resp = json.loads(text)
orgid = resp['data']['userOrgInfo']['orgId']
userid = resp['data']['userId']
print('userId:',userid)
print('orgId:',orgid)